package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.Result;
import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class leaseException extends RuntimeException{
    private Integer code;
    private String message;
    public leaseException(ResultCodeEnum resultCodeEnum){
       this.code =  resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();

    }
}
